home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 31
/
Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso
/
Aminet
/
comm
/
misc
/
MakeFTPScript.lha
/
MakeFTPScript
/
ARexx
/
MakeAMFTPScript.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-03-19
|
1KB
|
64 lines
/* MakeAMFTPScript v1.7 by Grzegorz Fitrzyk SP9WUN (domagal@uci.agh.edu.pl)
usage: rx rexx:MakeAMFTPScript.rexx SOURCE/K
ex.: rx rexx:MakeAMFTPScript.rexx ram:recent
*/
parse arg source
MODE=''
total=0
destin='t:amftpbatch.b'
options results
if Open(loadit, source, 'Read') then do /* Open source file.*/
if Open(Saveit, destin, 'Write') then do /* Open destination file. */
do forever
line=Readln(loadit)
if eof(loadit)~=0 then leave
if line="" then line="|"
parse var line '|'. header
if header="" then do
if line~="|" then do
call makeline
end
end
end
end; else call error_write
end; else call error_read
say 'Total size of requested files 'total'KB'
say 'Conversion succesfull.'
quitit:
call close(saveit)
call close(loadit)
address command 'c:filenote 'destin' 'total'KB'
exit
error_read:
say 'Cant find source file: 'source
call quitit
error_write:
say 'Cant write destination file 'dest
call quitit
makeline:
parse var line filename direct size rest
tt2=pos('+',size)
size2=size
if tt2~=0 then parse var size2 size '+'
exten=right(size,1)
if exten='?' then size='0K'
temp=length(size)
size=left(size,temp-1)
size=translate(size,,' ')
if exten="M" then size=size*1024
total=total+size
linecom='/pub/aminet/'||direct||'/'||filename||'|'||size
call writeln(saveit,linecom)
return